import http from "@/utils/http2.js";
/**
 * 查询询价表格
 * @param {*} data
 * @returns
 */
async function getEnquiry(data) {
  let res = await http.post("/enquiryList", data);
  return res;
}
/**
 * 查询报价
 * @param {*} enquiryCode
 * @returns
 */
async function getQuote(enquiryCode) {
  return await http.get("/getQuote", { enquiryCode });
}
/**
 * 报价修改
 * @param {*} data
 * @returns
 */
async function updateQuote(data) {
  return await http.put("/quote", data);
}
/**
 * 添加报价
 * @param {*} data
 * @returns
 */
async function addQuote(data) {
  return await http.post("/quote", data);
}
/**
 * 添加报价后修改状态
 * @param {*} enquiryCode
 * @returns
 */
async function updateStatus(inquiry) {
  return await http.post("/updateStatus", inquiry);
}
/**
 * 发货信息添加
 * @param {*} data
 * @returns
 */
async function addDeviler(data) {
  return await http.post("/deliver", data);
}
/**
 * 根据订单编码获取产品信息
 * @param {*} ordercode
 * @returns
 */
async function getProduct(ordercode) {
  return await http.get("/getProduct", { ordercode: ordercode });
}
/**
 * 生成进仓库通知单
 * @param {*} data
 * @returns
 */
async function addWarehouse(data) {
  return await http.post("/addWarehouse", data);
}
/**
 * 根据订单编号查询询价清单及要求
 * @param {*} ordercode
 * @returns
 */
async function getInquiry(ordercode) {
  return await http.get("/getInquiryByOrderCode", { ordercode });
}
export {
  getEnquiry,
  getQuote,
  updateQuote,
  addQuote,
  updateStatus,
  addDeviler,
  getProduct,
  addWarehouse,
  getInquiry
};
